package jjn.round1;

/**
 * @author Jjn
 * @since 2022/11/1 22:40
 */
public class LeetCode1662_CheckIfTwoStringArraysAreEqual {
    public boolean arrayStringsAreEqual(String[] word1, String[] word2) {
        String first = buildStringFromArray(word1);
        String second = buildStringFromArray(word2);
        return first.equals(second);
    }

    private String buildStringFromArray(String[] words) {
        StringBuilder builder = new StringBuilder();
        for (String word : words) {
            builder.append(word);
        }
        return builder.toString();
    }


}
